<template>

  <div id="homepage">
        <div id="head_search">
            <div id="weather">
                <i class="fa-solid fa-sun"></i>
                <span style="margin-left:3px">21℃</span>
            </div>
            <form>
                <input type="text" class="search" v-model="message" placeholder="油烟机清理"/>
                <button>搜索</button>
            </form>
            <!-- <i class="fa-solid fa-calendar-days"></i>
            <i class="fa-solid fa-barcode-read"></i> -->
            
        </div>

        <div id="advertising">
            <div class="block text-center" m="t-4">
                <br>
                <el-carousel trigger="click" height="150px">
                <el-carousel-item v-for="item in items" :key="item">
                    <!-- <h3 class="small justify-center" text="2xl">{{ item }}</h3> -->
                    <img :src="item.imgurl" style="width:100%">
                </el-carousel-item>
                </el-carousel>
            </div>
           
          
        </div>
        <div id="classify">
            <div class="simple_cleaning" @click="everyday">
                <h3>日常保洁</h3>
                <p>家庭日常清洁整理</p>
                <img src="@/assets/jzfw_img4.png">
            </div>
            <div class="care_baby" @click="care">
                <img src="@/assets/girl.jpg">
                <div>
                <h3>育儿看护</h3>
                <p>呵护母婴/小儿</p>
                </div>
            </div>
            <div class="nanny" @click="baomu">
                <img src="@/assets/baomu1.png">
                <div>
                <h3>保姆</h3>
                <p>放心更贴心</p>
                </div>
            </div>
        </div>
        <div id="top_up">
            <img src="@/assets/up.webp">
        </div>
        <div id="flex">
            <div class="xiabiao click" @click="icons('1')" >
               
                <i class="fa-solid fa-house-user"></i>
                <span>首页</span>
            </div>
            <div class="xiabiao" @click="icons('2')">
               <i class="fa-solid fa-list"></i>
                <span>订单</span>
            </div>
            <div class="xiabiao" @click="icons('3')">
                <i class="fa-regular fa-circle-user"></i>
                <span>客服</span>
            </div>
        </div>
    </div>
</template>

<script>

export default {
  name: 'baojie',
  data(){
      return{
          
          items:[
             {
                 imgurl:require("@/assets/baomu_banner.jpg")
            } ,
             {
                 imgurl:require("@/assets/yuer_banner.jpg")
            } ,
             {
                 imgurl:require("@/assets/jqbanner.jpg")
            } ,
             {
                 imgurl:require("@/assets/brand_introce.jpg")
            } 
          ]
      }
  },
   methods:{
       icons(id){
           if(id==='1'){
                this.$router.replace('/baomubaojie')
           }else if(id=='2'){
               this.$router.replace('/dingdan')
           }else{
               this.$router.replace('/wo')
           }
       },
       everyday(){
           this.$router.replace('/everyday')
       },
        baomu(){
           this.$router.replace('/baomu')
       },
        care(){
           this.$router.replace('/care')
       }
   }
}
</script>

<style scoped>
.demonstration {
  color: var(--el-text-color-secondary);
}

.el-carousel__item h3 {
  color: #ffdd88;
  opacity: 0.75;
  line-height: 150px;
  margin: 0;
  text-align: center;
}

.el-carousel__item:nth-child(2n) {
  background-color: #ffcf56;
}

.el-carousel__item:nth-child(2n + 1) {
  background-color: #ffdd88;
}
#advertising img{
    width: 100%;
    height: auto;
}
.img li{
    position: absolute;
    list-style: none;
    top: 0;
    left: 0;

}
.num{
    margin: auto;
    position: absolute;
    bottom: 8px;
    list-style: none;
}

.num li{
    display: inline-block;
    width: 20px;
    height: 20px;
    /* background-color: rgb(254, 104, 50); */
    border-radius: 50%;
    text-align: center;
    /* line-height: 18px; */
    margin:0 20px;
}

.num .active{
    background-color: red;
}
.hide{
    display: none;
}           
#homepage{
    /* margin: auto; */
    width:390px;
    height:844px;
   background-color: white;
}
#head_search{
    width: 390px;
    height: 50px;
    display:flex;
    
}
#head_search i{
    font-size: 25px;
}
input{
    height: 30px;
    width: 220px;
    border: 0.1rem solid #ddd;
    border-radius: 1rem;
    background-color: #ddd;
    transition: all 0.3s;
}
input:focus{
    background-color: white;
}
button{
    margin:5px  0 0 8px;
    border: 0.1rem solid rgba(255, 127, 80, 0.539);
    border-radius: 0.5rem;
    background-color: rgba(255, 127, 80, 0.539);
    color:rgb(88, 70, 70);
    width: 60px;
    height: 30px;
}
#weather{
    width: 55px;
    height: 50px;
    margin: 5px 5px 5px 10px;
}
#weather i{
    margin: 0 2px 2px 3px;
    color:coral;
}
#advertising{
    width: 390px;
    height: 25vh;
    position: relative;
}

#classify{
    margin: 35px 0 5px 0;
    height: 280px;
    width: 100%;
    display: grid;
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 1fr 1fr;
    grid-gap: 5px;
    background-color: rgb(252, 246, 225);
}
#classify p{
    color: rgb(114, 110, 110);
}
.simple_cleaning{
    background-color:white;
     position: relative;
    height: 280px;
    width: 100%;
    grid-row: 1/-1;
    grid-column: 1/2;
    /* border: 1px solid rgb(180, 177, 177); */
    
}
.simple_cleaning h3{
    margin-left: 5px;
    color: rgb(87, 184, 152);
}
.simple_cleaning p{
    margin-left: 5px;
}
.simple_cleaning img{
    position: relative;
bottom: -30px;
height: auto;
width: 190px;
}
.care_baby{
     background-color:white;
    display: flex;
    /* border: 1px solid rgb(180, 177, 177); */
    align-items: center;
}
.care_baby img{
    margin: 10px 10px 0 10px;
    height: 100px;
    width: 50px;
}
.care_baby h3{
   color: rgb(255, 198, 124);
}
.nanny{
     background-color:white;
    display: flex;
    /* border: 1px solid rgb(180, 177, 177); */
    align-items: center;
}
.nanny h3{
   color: rgb(255, 198, 124);
}
.nanny img{
    margin: 10px 10px 0 10px;
    height: 100px;
    width: 50px;
}
#top_up img{
    width: 100%;
    height: auto;
    margin-top:10px ;
}
#flex{
    bottom: 0;
    height: 80px;
    width: 390px;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr;
    text-align: center;
    font-size: 20px;
    position: fixed;

}
.xiabiao{
padding: 10px;
  background-color: rgb(242, 239, 239);
}
.xiabiao i{
     font-size: 30px;
     display: block;
}
.icon{
        color: rgb(255, 92, 33);
}
.xiabiao span{
    color: rgb(138, 134, 134);
   font-family: 'Courier New', Courier, monospace;
}
.click{
    color: rgb(255, 92, 33);
    
}
.click span{
    color: rgb(255, 92, 33);
    
}
</style>
